function drawGraphic(elem, data){
	var canvas = document.createElement('div');
	canvas.className = 'cv_container';
	var v = document.createElement('div');
	v.className = 'cv_canvas';
	var t = document.createElement('top');
	t.className = 'cv_top';
	var pn = document.createElement('div');
	pn.className = 'cv_panel';

	function drawColumn(v, max){
		var col_c = document.createElement('div');
		col_c.className = 'cv_col_c';
		if(max==0)
			max=1;
		var p = v / max < 0.01 ? 0.01 : v / max;
		col_c.style.height = '' + (p * 100) + '%';
		col_c.style.top = '' + (100 - p * 100) + '%';

		var col = document.createElement('div');
		col.className = 'cv_col';
		
		var vlb = document.createElement('div');
		vlb.className = 'cv_value_label';
		vlb.innerHTML = v;
		
		col_c.appendChild(col);
		col_c.appendChild(vlb);
		t.appendChild(col_c);
	}
	
	function drawLabels(k, v){
		var item = document.createElement('div');
		item.className = 'cv_label';
		
		var dlb = document.createElement('div');
		dlb.className = 'cv_date_label';
		var d = k.split('-');
		dlb.innerHTML = d[1] + '/' + d[2] + '<br />' + d[0];

		item.appendChild(dlb);
		pn.appendChild(item);
	}

	var maxValue = 0;
	for (e in data)	{
		if (data[e] > maxValue)	{
			maxValue = data[e];
		}
	}
	for (e in data){
		drawColumn(data[e], maxValue);
		drawLabels(e, data[e]);
	}
	v.appendChild(t);
	canvas.appendChild(v);
	canvas.appendChild(pn);
	elem.appendChild(canvas);
}

